<template>
	<view class="container">
		<view class="list">
			<view class="list_item" @click="toDetail(item.order_sn)" v-for="item in list" :key="item.id">
				<view class="left">
					<view class="img">
						<image src="/static/img/agent/record.png" mode="widthFix"></image>
					</view>
					<view class="item_l">
						<text>{{item.nickname}}</text>
						<text class="time">用时{{item.use_time}}</text>
					</view>
				</view>

				<view class="item_r">
					+￥{{item.pay_money}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		usaRecord
	} from '../../../api/api.js'
	export default {
		data() {
			return {
				// key: value
				list:[]
			}
		},
		onLoad() {
			this.getRecordList()
		},
		methods: {
			toDetail(order_sn) {
				uni.navigateTo({
					url: '/pages/detail/detail?order_sn=' + order_sn
				})
			},
			getRecordList() {
				usaRecord().then(res => {
					console.log(res)
					this.list = res.data.data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		width: 100%;
		height: 100%;
		background-color: #f6f6f6;
	}

	.list {
		width: 100%;
		background-color: #FFFFFF;
		// margin-top: 10upx;

		.list_item {
			width: calc(100% - 60upx);
			height: 130upx;
			margin: 0 auto;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1upx solid #f7f7f7;

			.left {
				display: flex;
				align-items: center;

				.img {
					width: 100upx;
					height: 100upx;
					background-color: #D8EFFF;
					border-radius: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-right: 20upx;

					image {
						width: 100%;
					}
				}

				.item_l {
					height: 80%;
					display: flex;
					font-size: 28upx;
					flex-direction: column;
					justify-content: space-around;

					.time {
						color: #999999;
						font-size: 24upx;
					}
				}
			}



			.item_r {
				color: #45d3c4;
				font-size: 36upx;
			}

		}

	}
</style>
